package com.igeek.boot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.igeek.boot.entity.ContractApprovals;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ContractApprovalsMapper extends BaseMapper<ContractApprovals> {

    @Select("select * from contract_approvals" )
    @Results({
            @Result(id = true,property = "approvalID",column = "approvalID"),
            @Result(property = "contractID",column = "contractID"),
            @Result(property = "contracts",column = "contractID",one = @One(select = "com.igeek.boot.mapper.ContractsMapper.select"))
    })
    Page<ContractApprovals> findPageByApp(Page<ContractApprovals> page, String queryString);

    @Delete("delete from contract_approvals where contractID = #{id}")
    boolean delContract(Integer id);
}
